<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:faces="http://java.sun.com/jsf/composite/faces/components">
 
    <composite:interface >
    	<composite:attribute name="create" type="java.lang.Boolean" default="true"/>
    	<composite:attribute name="edit" type="java.lang.Boolean" default="true"/>
    	<composite:attribute name="refresh" type="java.lang.Boolean" default="true"/>
    	<composite:attribute name="delete" type="java.lang.Boolean" default="true"/>
    	
    	<composite:attribute name="editView" type="java.lang.String" required="true"/>
	   	<composite:attribute name="actionBean" required="true"/>
    </composite:interface>
 
    <composite:implementation >
		<faces:button value="新增" action="#{cc.attrs.actionBean.create(cc.attrs.editView)}" execute="@this"
			render="#{formPanel.render}" onclick="onion.faces.formPanel.show(event);" rendered="#{cc.attrs.create}"/>
    	<faces:button value="打开" action="#{cc.attrs.actionBean.edit(cc.attrs.editView)}" render="#{formPanel.render}" 
			onclick="if(!onion.faces.list.checkSingleSelected('dataTable'))return false;onion.faces.formPanel.show(event);"
			 rendered="#{cc.attrs.edit}"/>
		<faces:confirmButton action="#{cc.attrs.actionBean.delete}" message="确定要删除选中的记录吗？"
			onclick="if(!onion.faces.list.checkSelected('dataTable'))return false;"
			value="删除" rendered="#{cc.attrs.delete}"/>
		<faces:button value="刷新" action="#{cc.attrs.actionBean.refresh}" render="#{faces.tools.tableRender}"
			execute="@this" rendered="#{cc.attrs.refresh}"/>
    </composite:implementation>
</ui:composition>